<template>
	<button class="add" @click="add">
		<image src="@/static/icons/添加.png" mode=""></image>
		<text>{{ props.title }}</text>
	</button>
</template>

<script setup>
const props = defineProps(['title']);
const add = () => {
	if (props.title === '添加车辆') {
		uni.navigateTo({
			url: '/pages/addCar/addCar'
		});
	}
};
</script>

<style lang="scss">
.add {
	border: none;
	background-color: #006eff;
	display: flex;
	align-items: center;
	justify-content: center;
	color: #fff;
	margin: 30rpx 0;
	image {
		width: 40rpx;
		height: 40rpx;
		margin: 0 20rpx;
	}
}
</style>
